
PREFIX ?= /usr/local/

LIBNAME = logger

all:static_lib shared_lib

static_lib:
	@gcc -c *.c
	ar -rcs lib${LIBNAME}.a *.o

shared_lib:i
	gcc -fPIC -shared -o lib${LIBNAME}.so *.c

clean:
	rm -f *.o

distclean:clean
	rm -f *.so *.a

install:
	mkdir -p ${PREFIX}/lib
	mkdir -p ${PREFIX}/include
	cp lib*.a lib*.so ${PREFIX}/lib
	cp *.h ${PREFIX}/include

uninstall:
	rm -f ${PREFIX}/lib/lib${LIBNAME}.*
	rm -f ${PREFIX}/include/logger.h
